package com.cn.springcloudwechat.controller;

import com.cn.springcloudwechat.common.ajax.AjaxRes;
import com.cn.springcloudwechat.common.utils.base.Const;
import com.cn.springcloudwechat.controller.vaccine.log.LogInfo;
import com.cn.springcloudwechat.controller.vaccine.log.OperateType;
import com.cn.springcloudwechat.model.YmAnswer;
import com.cn.springcloudwechat.service.YmAnswerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/web/answer/")
public class YmAnswerController {

    @Autowired
    private YmAnswerService ymAnswerService;


    @RequestMapping("answerQuantity")
    @LogInfo(content = "回复数量", operateType = OperateType.QUERY)
    public AjaxRes getAnswerQuantity(AjaxRes ajaxRes,Integer type,Long typeId){
        try{
            Long list=ymAnswerService.getAnswerQuantity(typeId,type);
            ajaxRes.setSucceed(list, Const.DATA_SUCCEED);
        }catch (Exception e){
            ajaxRes.setFailMsg(e.getMessage());
        }
        return ajaxRes;
    }
}
